import request from "@/utils/request";

export function listTransaction(params) {
  return request({
    url: "/transaction",
    method: "get",
    params,
  });
}

export function listPageTransaction(params) {
  return request({
    url: "/transaction/page",
    method: "get",
    params,
  });
}

export function saveTransaction(params) {
  return request({
    url: "/transaction",
    method: "post",
    data: params,
  });
}

export function updateTransaction(id,params) {
  return request({
    url: `/transaction/${id}`,
    method: "put",
    data: params,
  });
}

export function deleteTransaction(id) {
  return request({
    url: `/transaction/${id}`,
    method: "delete",
  });
}

export function deleteBatchTransaction(idList) {
  return request({
    url: `/transaction/batch`,
    method: "delete",
    data: idList,
  });
}

export function getTransactionById(id) {
  return request({
    url: `/transaction/${id}`,
    method: "get",
  });
}
